<?php

$from_name = $dealer_name;
$from_email = $dealer_email;
$to_name = $friend_name;
$to_email = $friend_email;
$subject = "Product Selection from " . $from_name;



$content = <<<EOT


<html>
<head>
<link href="{$web_url}css/jansenfurniture.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" height="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top" align="center"><div><img name="" src="{$web_url}images/spacer.gif" width="568" height="10" alt=""></div>
      <table width="568" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td background="{$web_url}images/colour/jf_colour_navy_100.gif"><img name="" src="{$web_url}images/spacer.gif" width="568" height="1" alt=""></td>
        </tr>
        <tr>
          <td bgcolor="FFFFFF" width="568" align="left" valign="top"><table width="568" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td background="{$web_url}images/colour/jf_colour_navy_100.gif" width="1"><img name="" src="{$web_url}images/spacer.gif" width="1" height="1" alt=""></td>
                <td width="568" align="left" valign="top" background="{$web_url}images/colour/jf_colour_navy_07.gif"><div><img name="" src="{$web_url}images/spacer.gif" width="568" height="5" alt=""></div>
                  <table width="568" border="0" cellspacing="0" cellpadding="0">
                    <!--tr>
                      <td width="5"><img name="" src="{$web_url}images/spacer.gif" width="5" height="5" alt=""></td>
                      <td bgcolor="FFFFFF" width="10"><img name="" src="{$web_url}images/spacer.gif" width="10" height="10" alt=""></td>
                      <td bgcolor="FFFFFF" width="538"><img name="" src="{$web_url}images/spacer.gif" width="538" height="10" alt=""></td>
                      <td bgcolor="FFFFFF" width="10"><img name="" src="{$web_url}images/spacer.gif" width="10" height="10" alt=""></td>
                      <td width="1" align="left" valign="top" background="{$web_url}images/colour/jf_colour_navy_15.gif"><img name="" src="{$web_url}images/colour/jf_colour_navy_07.gif" width="1" height="1" alt=""></td>
                      <td width="4"><img name="" src="{$web_url}images/spacer.gif" width="4" height="4" alt=""></td>
                    </tr-->
                    <tr>
                      <td width="5"><img name="" src="{$web_url}images/spacer.gif" width="5" height="5" alt=""></td>
                      <td bgcolor="FFFFFF" width="10"><img name="" src="{$web_url}images/spacer.gif" width="10" height="10" alt=""></td>
                      <td bgcolor="FFFFFF" width="538" class="text"><div><img name="" src="{$web_url}images/spacer.gif" width="538" height="10" alt=""></div>
                        <!--div align="center"><img src="{$web_url}images/nav/jf_nav_logo.gif" alt="jans2en furniture" name="jf_nav_logo" width="150" height="210" id="jf_nav_logo"></div>
                        <div><img name="" src="{$web_url}images/spacer.gif" width="538" height="10" alt=""></div>
                        
                        <div class="paragraphSpacer"><img name="" src="{$web_url}images/spacer.gif" width="0" height="0" alt=""></div-->


EOT;

$content .= <<<EOT
                        <table width="538" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td>                     

        			    		<table width="538" border="0" cellspacing="0" cellpadding="0" align="center">
        			    		
        			    		<tr><td colspan=8 align="left" class="titles">Dear $to_name:</td></tr>
        			    		<tr><td colspan=8 height=5></td></tr>
        			    		<tr><td colspan=8 height=5></td></tr>

        			    		
        			    		<!--tr><td colspan=8>Here is a product selection from {$from_name}.</td></tr-->
        			    		<tr><td colspan=8 height=5></td></tr>
        			    		<tr><td colspan=8 height=5></td></tr>
        			    		
                                <tr><td colspan=8>$message</td></tr>
        			    		<tr><td colspan=8 height=5></td></tr>
        			    		<tr><td colspan=8 height=5></td></tr>

        			    		
        			    		<tr><td colspan=8 height=5></td></tr>
        			    		<tr><td colspan=8 height=5></td></tr>	
        			    		<tr><td colspan=8 bgcolor="#000000" height=1></td></tr>															
        						<tr class="cartAlternatingRowB"  height="30">
        						    <td align="center" valign="middle" class="cartHeading" width="120"></td>
        			    			<td align="center" valign="middle" class="cartHeading" width="80">Item No.</td>
        			    			<td align="right" valign="middle" class="cartHeading" width="60">W</td>
        			    			<td align="right" valign="middle" class="cartHeading" width="60">D</td>
        			    			<td align="right" valign="middle" class="cartHeading" width="60">H</td>
        			    			<td align="center" valign="middle" class="cartHeading" width="20"></td>
        			    			<td align="right" valign="middle" class="cartHeading" width="60">Cbm</td>
        			    			<td align="right" valign="middle" class="cartHeading" width="60">Cuft</td>
        						</tr>
        						<tr><td colspan=8 bgcolor="#A5AAB0" height=1></td></tr>
EOT;

foreach ($product_ary as $k=>$v) {
    if (trim($v['small_pic']) == "" || !file_exists("./attachments/" . $v['small_pic'])) {
        $v['small_pic'] = 'no_113.gif';
    }
    $v['width']   = number_format($v['width'], 2, '.', ',');
    $v['length']  = number_format($v['length'], 2, '.', ',');
    $v['height']  = number_format($v['height'], 2, '.', ',');
    $v['width2']  = number_format($v['width2'], 2, '.', ',');
    $v['length2'] = number_format($v['length2'], 2, '.', ',');
    $v['height2'] = number_format($v['height2'], 2, '.', ',');
    $v['cbm']     = number_format($v['cbm'], 2, '.', ',');
    $v['cuft']    = number_format($v['cuft'], 2, '.', ',');
$content .= <<<EOT

        			            <tr class="cartAlternatingRowB1" height="60">
        			                <td align="center" valign="middle" width="120" rowspan=2><img src="{$web_url}attachments/{$v['small_pic']}" border="0" class="picture" width="113" height="113"></td>	    			
        			    			<td align="center" valign="middle"  width="80" rowspan=2>{$v['code']}</td>
        			    			
        			    			<td align="right" valign="middle" >{$v['width']}</td>
        			    			<td align="right" valign="middle">{$v['length']}</td>
        			    			<td align="right" valign="middle">{$v['height']}</td>
        			    			<td align="center" valign="middle"><strong>[cm]</strong></td>
        			    			
        			    			<td align="right" valign="middle" rowspan=2>{$v['cbm']}</td>
        			    			<td align="right" valign="middle" rowspan=2>{$v['cuft']}</td>
        						</tr>
        						
        						<tr class="cartAlternatingRowB1" height="60">        			    			
        			    			<td align="right" valign="top" >{$v['width2']}</td>
        			    			<td align="right" valign="top">{$v['length2']}</td>
        			    			<td align="right" valign="top">{$v['height2']}</td> 
        			    			<td align="center" valign="top"><strong>[inch]</strong></td> 
        						</tr>
        						

EOT;
} 
$content .= <<<EOT
        						<tr><td colspan=8 bgcolor="#A5AAB0" height=1></td></tr>
        					   						
        						
        						<tr><td colspan=8 height=5></td></tr>
        			    		<tr><td colspan=8 height=5></td></tr>
        						<tr><td colspan=8>
                                </td></tr>
        			    		
        						</td></tr>
        						</table>						
                      
                              
                            
                            </td>
                          </tr>
                          <tr>
                            <td align="right" valign="bottom"><div class="paragraphSpacer"><img name="" src="{$web_url}images/spacer.gif" width="0" height="0" alt=""></div>
                              <div align="right"><img src="{$web_url}images/colour/jf_colour_gold_100.gif" alt="Gold Accent" name="jf_colour_gold_100" width="10" height="10" id="jf_colour_gold_100"></div></td>
                          </tr>
                        </table>
                        
                        
                        </td>
                      <td bgcolor="FFFFFF" width="10"><img name="" src="{$web_url}images/spacer.gif" width="10" height="10" alt=""></td>
                      <td width="1" align="left" valign="top" background="{$web_url}images/colour/jf_colour_navy_15.gif"><img name="" src="{$web_url}images/colour/jf_colour_navy_07.gif" width="1" height="1" alt=""></td>
                      <td width="4"><img name="" src="{$web_url}images/spacer.gif" width="4" height="4" alt=""></td>
                    </tr>
                    <tr>
                      <td width="5"><img name="" src="{$web_url}images/spacer.gif" width="5" height="5" alt=""></td>
                      <td bgcolor="FFFFFF" width="10"><img name="" src="{$web_url}images/spacer.gif" width="10" height="10" alt=""></td>
                      <td bgcolor="FFFFFF" width="538"><img name="" src="{$web_url}images/spacer.gif" width="538" height="10" alt=""></td>
                      <td bgcolor="FFFFFF" width="10"><img name="" src="{$web_url}images/spacer.gif" width="10" height="10" alt=""></td>
                      <td width="1" align="left" valign="top" background="{$web_url}images/colour/jf_colour_navy_15.gif"><img name="" src="{$web_url}images/colour/jf_colour_navy_07.gif" width="1" height="1" alt=""></td>
                      <td width="4"><img name="" src="{$web_url}images/spacer.gif" width="4" height="4" alt=""></td>
                    </tr>
                    <tr>
                      <td width="5"><img name="" src="{$web_url}images/spacer.gif" width="5" height="1" alt=""></td>
                      <td width="10" align="left" valign="top" background="{$web_url}images/colour/jf_colour_navy_15.gif"><img name="" src="{$web_url}images/colour/jf_colour_navy_07.gif" width="1" height="1" alt=""></td>
                      <td background="{$web_url}images/colour/jf_colour_navy_15.gif" width="538"><img name="" src="{$web_url}images/spacer.gif" width="538" height="1" alt=""></td>
                      <td background="{$web_url}images/colour/jf_colour_navy_15.gif" width="10"><img name="" src="{$web_url}images/spacer.gif" width="10" height="1" alt=""></td>
                      <td width="1" align="left" valign="top" background="{$web_url}images/colour/jf_colour_navy_15.gif"><img name="" src="{$web_url}images/colour/jf_colour_navy_15.gif" width="1" height="1" alt=""></td>
                      <td width="4"><img name="" src="{$web_url}images/spacer.gif" width="4" height="1" alt=""></td>
                    </tr>
                  </table>
                  <div><img name="" src="{$web_url}images/spacer.gif" width="568" height="4" alt=""></div></td>
                <td background="{$web_url}images/colour/jf_colour_navy_100.gif" width="1"><img name="" src="{$web_url}images/spacer.gif" width="1" height="1" alt=""></td>
              </tr>              
            </table></td>
        </tr>
      </table>
      <div><img name="" src="{$web_url}images/spacer.gif" width="568" height="10" alt=""></div></td>
  </tr>
</table>
</body>
</html>


EOT;

?>